package cn.tannn.cat.file.server.controller.manage.dto;

import cn.tannn.cat.file.server.entity.StorageBucket;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 新增存储桶
 *
 * @author <a href="https://tannn.cn/">tan</a>
 * @date 2024/3/8 9:34
 */
@Schema(description = "新增存储桶")
@ToString
@Getter
@Setter
public class StorageBucketAppend {

    /**
     * 桶名
     */
    @Schema(description = "桶名",requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "桶名不能为空")
    private String bucketName;

    /**
     * 字典键值
     */
    @Schema(description = "存储器Id",requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "存储器Id不能为空")
    private String configId;


    /**
     * 字典键值
     */
    @Schema(description = "存储器名",requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "存储器名不能为空")
    private String configName;


    /**
     * 备注
     */
    @Schema(description = "备注")
    private String bucketRemark;

    public StorageBucket toStorageBucket(){
        StorageBucket bucket = new StorageBucket();
        bucket.setName(bucketName);
        bucket.setConfigId(configId);
        bucket.setConfigName(configName);
        bucket.setRemark(bucketRemark);
        return bucket;
    }
}
